import { createRouter, createWebHashHistory } from 'vue-router'

const routes = [
  {
    path: '/',
    component: () => import('@/views/Layout/index.vue'),
    children: [
      {
        path: 'category',
        component: () => import('@/views/Category/index.vue')
      },
      {
        path: 'home',
        component: () => import('@/views/Home/index.vue')
      },
      {
        path: 'product',
        component: () => import('@/views/Product/index.vue')
      },
      {
        path: 'cart',
        component: () => import('@/views/Cart/index.vue')
      },
      {
        path: 'checkout',
        component: () => import('@/views/Checkout/index.vue')
      },
      {
        path: 'pay',
        component: () => import('@/views/Pay/index.vue')
      },
      {
        path: 'result',
        component: () => import('@/views/Pay/result.vue')
      }
    ]
  },
  {
    path: '/login',
    component: () => import('@/views/Login/index.vue')
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
